#ifndef GCS_H
#define GCS_H

#include <QTimer>

#include "common.h"
#include "aeroquadmodel.h"
#include "viconmodel.h"

class GCS : public QObject
{
    Q_OBJECT
public:
    explicit GCS(QObject *parent = 0);

    AeroQuadModel _aeroQuadModel;
    VICONModel _VICONModel;

    QString GetFileLogLocation();
    void SetFileLogLocation(QString newFileLogLocation);
    bool isFileLoggingRunning();
    void toggleFileLogging();


private:
    QTimer _fileLoggingTimer;

    bool _fileLoggingRunning;
    QString _fileLogLocation;
    QString _fileLogName;

    void StartFileLogging();
    void StopFileLogging();
    void ChangeFileLoggingUpdateFrequency(int updateRate);

    QString getCurrentDateTimeAsString(bool withMilliseconds, QString valueSeperator = "_");

    void SendRollGainsToArduino();
    void SendPitchGainsToArduino();
    void SendYawGainsToArduino();

    void DEBUG_DoSevenSegDataTest();
    void DEBUG_DoSevenSegRateTest();
    void DEBUG_DoAHDataTest();
    void DEBUG_DoBlackAndWhiteBoxTests();

signals:
    void newLogFileCreated();

public slots:

private slots:
    void SendVICONValuesToArduino();
    void ProcessUpdatedAeroQuadModel();

    void UpdateFileLog();

};

#endif // GCS_H
